<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="keywords" content="admin, dashboard, bootstrap, template, flat, modern, theme, responsive, fluid, retina, backend, html5, css, css3">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="image/png">

  <title>{:lang('用户管理')}</title>
  
  <!--common-->
  <link href="/static/css/public/style.css" rel="stylesheet">
  <link href="/static/css/public/style-responsive.css" rel="stylesheet">

  <!--dynamic table-->
  <link href="/static/js/public/advanced-datatable/css/demo_page.css" rel="stylesheet" />
  <link href="/static/js/public/advanced-datatable/css/demo_table.css" rel="stylesheet" />
  <link rel="stylesheet" href="/static/js/public/data-tables/DT_bootstrap.css" />


  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->
</head>

<body class="sticky-header">
	<!-- 左侧菜单开始-->
	{include file="public/nav_left"}
    <!-- 左侧菜单结束-->
    
    <!-- main content start-->
    <div class="main-content" >

        <!-- 头部菜单开始-->
          {include file="public/nav_top"}
        <!-- 头部菜单结束-->
        
        
        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                {:lang('用户管理')}
            </h3>
            
        </div>
        <!-- page heading end-->

        <!--主内容开始-->
        <div class="wrapper">
            <div class="row">
        <div class="col-sm-12">
        <section class="panel">
        <header class="panel-heading">
            {:lang('用户列表')}
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <!--<a href="javascript:;" class="fa fa-times"></a>-->
             </span>
        </header>
        <div class="panel-body">
        <div class="adv-table">
        
        <div class="clearfix">
            <div class="btn-group">
                <a id="editable-sample_new" class="btn btn-primary" href="/admin/User/getEdit">
                    {:lang('新增')} <i class="fa fa-plus"></i>
                </a>
            </div>
            <!--<div class="btn-group pull-right">-->
                <!--<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">工具 <i class="fa fa-angle-down"></i>-->
                <!--</button>-->
                <!--<ul class="dropdown-menu pull-right">-->
                    <!--<li><a href="#">打印</a></li>-->
                    <!--<li><a href="#">另存为PDF</a></li>-->
                    <!--<li><a href="#">导出Excel</a></li>-->
                <!--</ul>-->
            <!--</div>-->
        </div>
        <div class="space15"></div>
                
        <table class="display table table-bordered table-striped" id="dynamic-table">
        <thead>
        <tr>
            <th>{:lang('序号')}</th>
            <th width="350px">{:lang('用户名称')}</th>
            <th>{:lang('超级管理员')}</th>
            <th>{:lang('状态')}</th>
            <th>{:lang('注册时间')}</th>
            <th>{:lang('上次登录时间')}</th>
            <th>{:lang('操作')}</th>
        </tr>
        </thead>
        <tbody>
        
        {volist name="data" key="key" id="vo"}
            <tr class="gradeA">
                <td>{$key}</td>
                <td>{$vo.user_name}</td>
                <td>{if condition="$vo['is_admin'] eq 1"}{:lang('是')}{else /}{:lang('否')}{/if}</td>
                <td>{if condition="$vo['user_status'] eq 1"}{:lang('使用中')}{else /}{:lang('停止使用')}{/if}</td>
                <td>{$vo.register_date} {$vo.register_time}</td>
                <td>{$vo.last_date} {$vo.last_time}</td>
                <td><a class="label label-sm btn-success" href="/admin/User/getEdit/id/{$vo.id}">{:lang('编辑')}</a>&nbsp;<a class="label label-sm btn-danger" onClick="delUser({$vo.id})">{:lang('删除')}</a>&nbsp;<a class="btn btn-primary btn-xs" onClick="pwdEdit({$vo.id})">{:lang('重置密码')}</a></td>
            </tr>
        {/volist}
        
        
        </tbody>
        <!--<tfoot>
        <tr>
            <th>Rendering engine</th>
            <th>Browser</th>
            <th>Platform(s)</th>
            <td></td>
            <th class="hidden-phone">Engine version</th>
            <th class="hidden-phone">CSS grade</th>
        </tr>
        </tfoot>-->
        </table>
        </div>
        </div>
        </section>
        </div>
        </div>

        
        
            
        </div>
        <!--主内容结束-->


    </div>
    <!-- main content end-->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="/static/js/public/jquery-1.10.2.min.js"></script>
<script src="/static/js/public/jquery-ui-1.9.2.custom.min.js"></script>
<script src="/static/js/public/jquery-migrate-1.2.1.min.js"></script>
<script src="/static/js/public/bootstrap.min.js"></script>
<script src="/static/js/public/modernizr.min.js"></script>
<script src="/static/js/public/jquery.nicescroll.js"></script>
<script src="/static/js/public/layer.js"></script>

<!--dynamic table-->
<script src="/static/js/public/advanced-datatable/js/jquery.dataTables.js"></script>
<script src="/static/js/public/data-tables/DT_bootstrap.js"></script>
<!--dynamic table initialization -->
<script src="/static/js/public/dynamic_table_init.js"></script>

<!--common scripts for all pages-->
<script src="/static/js/public/scripts.js"></script>
<script>
    //重置用户密码
    function pwdEdit(id){
        layer.confirm('确定重置该用户密码? (新密码: cxac2020. )', {
            btn: ['确定','取消'] //按钮
        }, function(){
            var params = {};
            params.user_id = id;
            $.post("/admin/User/pwdReset",params,function(data){
                layer.msg(data.msg);
                if(data.status === 1) {
                    setTimeout(function(){
                        window.location.reload()
                    }, 1500)
                }
            });
        });
    }
    //删除用户
    function delUser(id){
        layer.confirm('确定删除该用户?', {
            btn: ['是', '否'] //按钮
        }, function(){
            var params = {};
            params.id = id;
            $.post("/admin/User/delUser",params,function(data){
                layer.msg(data.msg);
                if(data.status === 1) {
                    setTimeout(function(){
                        window.location.reload()
                    }, 1500)
                }
            });
        });
    }
</script>
</body>
</html>
